package org.farm.common.response.enums;

import lombok.Getter;

/**
 * @author Frank Zou
 * @version v0.0.1
 * @date 2025/4/9
 * @description 业务异常类
 */
@Getter
public class BusinessException extends RuntimeException {

    private final ExceptionCode exceptionCode;


    public BusinessException(ExceptionCode exceptionCode) {
        super(exceptionCode.getMessage());
        this.exceptionCode = exceptionCode;
    }

    public BusinessException(ExceptionCode exceptionCode, String message) {
        super(message);
        this.exceptionCode = exceptionCode;
    }

    public BusinessException(ExceptionCode exceptionCode, Throwable cause) {
        super(exceptionCode.getMessage(), cause);
        this.exceptionCode = exceptionCode;
    }

}
